'use strict';

const {getDefaultModelConfig} = require("../../utils/common");
module.exports = app => {
  const { BIGINT } = app.Sequelize;

  return app.model.define('SystemUserRole', {
    id: {
      type: BIGINT,
      primaryKey: true,
      autoIncrement: true,
      comment: '自增编号'
    },
    userId: {
      type: BIGINT,
      allowNull: false,
      field: 'user_id',
      comment: '用户ID'
    },
    roleId: {
      type: BIGINT,
      allowNull: false,
      field: 'role_id',
      comment: '角色ID'
    },
    ...getDefaultModelConfig(app)
  }, {
    tableName: 'system_user_role',
    timestamps: false, // 不使用Sequelize的默认时间戳字段
  });
};
